﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="Statistics.aspx.vb" Inherits="Veterans.Statistics" %>
<%@ Register assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI.DataVisualization.Charting" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        &nbsp;</p>
    <p>
        &nbsp;Refresh If the Charts does not Show Up</p>
    <p>
        Top 5 rated Topics :<br />
    </p>
    <p style="text-align: center;">
        <asp:Chart ID="Chart1" runat="server" DataSourceID="SqlDataSource1" 
            Width="825px">
            <series>
                <asp:Series Name="Series1" ChartType="Bar" XValueMember="T_Title" 
                    YValueMembers="AvgOfRate">
                </asp:Series>
            </series>
            <chartareas>
                <asp:ChartArea Name="ChartArea1">
                </asp:ChartArea>
            </chartareas>
        </asp:Chart>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            SelectCommand="SELECT top 5 [T_Title], [AvgOfRate] FROM [Topics_withAvgRating]">
        </asp:SqlDataSource>
    </p>
    <p>
        Top 5 searched Phrases :</p>
    <p style="text-align: center;">
        <asp:Chart ID="Chart2" runat="server" DataSourceID="SqlDataSource2" 
            Width="836px">
            <Series>
                <asp:Series ChartType="Doughnut" Name="Series1" XValueMember="S_Phrase" YValueMembers="CountPhrases">
                </asp:Series>
            </Series>
            <ChartAreas>
                <asp:ChartArea Name="ChartArea1">
                </asp:ChartArea>
            </ChartAreas>
        </asp:Chart>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            SelectCommand="SELECT top 5 [CountPhrases], [S_Phrase] FROM [Top_Searched_Phrases_Qry]">
        </asp:SqlDataSource>
    </p>
    <p>
        Top 5 most Viewed Topics :</p>
    <p style="text-align: center;">
        <asp:Chart ID="Chart3" runat="server" DataSourceID="SqlDataSource3" 
            Width="862px">
            <Series>
                <asp:Series ChartType="Point" Name="Series1" XValueMember="T_Title" 
                    YValueMembers="CountViewed" YValuesPerPoint="2">
                </asp:Series>
            </Series>
            <ChartAreas>
                <asp:ChartArea Name="ChartArea1">
                </asp:ChartArea>
            </ChartAreas>
        </asp:Chart>
        <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            SelectCommand="SELECT top 5 [CountViewed], [Topic_fkiD], [T_Title] FROM [CountViewed_Query]">
        </asp:SqlDataSource>
    </p>
    <p>
        Top 5 most Liked Topics :</p>
    <p style="text-align: center;">
        <asp:Chart ID="Chart4" runat="server" DataSourceID="SqlDataSource4" 
            Width="886px">
            <Series>
                <asp:Series ChartType="Pie" Name="Series1" XValueMember="T_Title" 
                    YValueMembers="CountLikes">
                </asp:Series>
            </Series>
            <ChartAreas>
                <asp:ChartArea Name="ChartArea1">
                </asp:ChartArea>
            </ChartAreas>
        </asp:Chart>
        <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            SelectCommand="SELECT top 5 [CountLikes], [Topic_fkID], [T_Title] FROM [CountTopicLikes_Query]">
        </asp:SqlDataSource>
    </p>
</asp:Content>
